<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let p = new Promise((resolve ,reject)=>{
            // 1. resolve  reject 不调用
            // 2. 执行resolve
            // resolve('ok');
            // 3. 执行reject('error')
            reject('error');
        })
        //                 p: PromiseState      PromiseResult:
        //                      pending         undefined
        // resolve(value)       fulfilled       value
        // reject(reason)       rejected        reason

        console.log('p: ', p);
        p.then(value=>{
            console.log('成功： ', value);
        }, reason=>{
            console.log('失败: ', reason);
        })
    </script> 
</body>
</html>